package org.example.springvalidation;


import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @PostMapping("/user")
    public ResponseEntity<String> createUser(@Validated @RequestBody @UniqueEmail UserDTO userDTO) {
        return ResponseEntity.ok("用户注册成功");
    }
}
